package com.ls.fw.office.poi.excel.bean;

/**
 * The HSSFClientAnchor class accepts eight arguments. In order, these are;
 *
 *      * How far the left hand edge of the image is inset from the left hand
 *      edge of the cell
 *      * How far the top edge of the image is inset from the top of the cell
 *      * How far the right hand edge of the image is inset from the left
 *      hand edge of the cell
 *      * How far the bottom edge of the image is inset from the top of the
 *      cell.
 *      * Together, arguments five and six determine the column and row
 *      coordinates of the cell whose top left hand corner will be aligned
 *      with the images top left hand corner.
 *      * Together, arguments seven and eight determine the column and row
 *      coordinates of the cell whose top left hand corner will be aligned
 *      with the images bottom right hand corner.
 *
 * An instance of the ClientAnchorDetail class provides three of the eight
 * parameters, one of the coordinates for the images top left hand corner,
 * one of the coordinates for the images bottom right hand corner and
 * either how far the image should be inset from the top or the left hand
 * edge of the cell.
 *
 * @author Mark Beardsley [msb at apache.org]
 * @version 1.00 5th August 2009.
 */
public class ClientAnchorDetail {

    public int fromIndex = 0;
    public int toIndex = 0;
    public int inset = 0;

    /**
     * Create a new instance of the ClientAnchorDetail class using the
     * following parameters.
     *
     * @param fromIndex A primitive int that contains one of the
     *                  coordinates (row or column index) for the top left
     *                  hand corner of the image.
     * @param toIndex A primitive int that contains one of the
     *                coordinates (row or column index) for the bottom
     *                right hand corner of the image.
     * @param inset A primitive int that contains a value which indicates
     *              how far the image should be inset from the top or the
     *              left hand edge of a cell.
     */
    public ClientAnchorDetail(int fromIndex, int toIndex, int inset) {
        this.fromIndex = fromIndex;
        this.toIndex = toIndex;
        this.inset = inset;
    }

    /**
     * Get one of the number of the column or row that contains the cell
     * whose top left hand corner will be aligned with the top left hand
     * corner of the image.
     *
     * @return The value - row or column index - for one of the coordinates
     *         of the top left hand corner of the image.
     */
    public int getFromIndex() {
        return(this.fromIndex);
    }

    /**
     * Get one of the number of the column or row that contains the cell
     * whose top left hand corner will be aligned with the bottom right hand
     * corner of the image.
     *
     * @return The value - row or column index - for one of the coordinates
     *         of the bottom right hand corner of the image.
     */
    public int getToIndex() {
        return(this.toIndex);
    }

    /**
     * Get the images offset from the edge of a cell.
     *
     * @return How far either the right hand or bottom edge of the image is
     *         inset from the left hand or top edge of a cell.
     */
    public int getInset() {
        return(this.inset);
    }
}